using System;
using UnityEngine;

namespace GamePlay.Features.Shared
{
    #region 网络事件

    /// <summary>
    /// 服务器连接成功事件参数
    /// </summary>
    [Serializable]
    public class ConnectServerArgs : EventArgs
    {
        public DateTime ConnectTime { get; private set; } = DateTime.Now;
    }

    /// <summary>
    /// 服务器断开连接事件参数
    /// </summary>
    [Serializable]
    public class DisconnectServerArgs : EventArgs
    {
        public DateTime DisconnectTime { get; private set; } = DateTime.Now;
        public bool IsNormal { get; set; } = true;
    }

    /// <summary>
    /// 网络等待状态事件参数
    /// </summary>
    [Serializable]
    public class NetworkWaiting : EventArgs
    {
        public bool waiting;
        public int messageId;
    }

    #endregion

    #region 游戏流程事件

    /// <summary>
    /// 游戏开始事件参数
    /// </summary>
    [Serializable]
    public class GameStartArgs : EventArgs
    {
        public int GameMode { get; set; }
        public string LevelName { get; set; }
    }

    /// <summary>
    /// 游戏结束事件参数
    /// </summary>
    [Serializable]
    public class GameEndArgs : EventArgs
    {
        public bool IsWin { get; set; }
        public int Score { get; set; }
        public float Duration { get; set; }
    }

    /// <summary>
    /// 游戏暂停事件参数
    /// </summary>
    [Serializable]
    public class GamePauseArgs : EventArgs
    {
        public bool IsPaused { get; set; }
    }

    #endregion

    #region 玩家事件

    /// <summary>
    /// 玩家数据更新事件参数
    /// </summary>
    [Serializable]
    public class PlayerDataUpdateArgs : EventArgs
    {
        public string PlayerId { get; set; }
        public int Level { get; set; }
        public int Exp { get; set; }
        public int Gold { get; set; }
    }

    /// <summary>
    /// 玩家状态变化事件参数
    /// </summary>
    [Serializable]
    public class PlayerStateChangeArgs : EventArgs
    {
        public string PlayerId { get; set; }
        public PlayerState OldState { get; set; }
        public PlayerState NewState { get; set; }
    }

    /// <summary>
    /// 玩家状态枚举
    /// </summary>
    public enum PlayerState
    {
        Idle,
        Moving,
        Attacking,
        Defending,
        Dead
    }

    #endregion

    #region UI事件

    /// <summary>
    /// UI显示事件参数
    /// </summary>
    [Serializable]
    public class UIShowArgs : EventArgs
    {
        public string UIName { get; set; }
        public object Data { get; set; }
    }

    /// <summary>
    /// UI隐藏事件参数
    /// </summary>
    [Serializable]
    public class UIHideArgs : EventArgs
    {
        public string UIName { get; set; }
    }

    #endregion
}